package com.itxx.keycase.blockingqueue;

import java.util.concurrent.ArrayBlockingQueue;

public class Foodie  extends  Thread {
    private ArrayBlockingQueue<String> strings;


    public Foodie(ArrayBlockingQueue<String> strings) {
        this.strings = strings;
    }

    public Foodie() {
    }

    @Override
    public void run() {
        while (true) {
            try {
                strings.take();
                System.out.println("吃货吃了一个包子");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
